package com.jinzhending.controller.wx;

import com.jinzhending.entity.Category;
import com.jinzhending.service.wx.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @ProjectName: LieIdle
 * @Package: com.jinzhending.controller.wx  分类controller
 * @Author: huat
 * @Date: 2020/4/4 9:31
 * @Version: 1.0
 */
@RestController
@RequestMapping("wx/category")
public class CategoryController {
    @Autowired
    CategoryService categoryService;

    /**
     * 获取菜单列表
     * @return
     */
    @RequestMapping("getAllCategory")
    @Cacheable(cacheNames = "Category")
    public Map<String,Object> getAllCategory(){
        Map<String,Object> map=new HashMap<String,Object>();
        map.put("code",0);
        map.put("message","");
        map.put("data",categoryService.getAllCategory());
        return map;
    }
}
